# Uncomment this if you reference any of your controllers in activate
# require_dependency 'application'

class ExternalRssExtension < Radiant::Extension
  version "0.1"
  description "Provides for the incorporation of content via external RSS feeds."
  url "http://code.google.com/p/radiant-externalrss-extension/"
  
  define_routes do |map|
    map.external_rss_feed_index 'admin/external_rss', :controller => 'admin/external_rss_feed', :action => 'index'
    map.external_rss_feed_new 'admin/external_rss/new', :controller => 'admin/external_rss_feed', :action => 'new'
    map.external_rss_feed_edit 'admin/external_rss/edit/:id', :controller => 'admin/external_rss_feed', :action => 'edit'
    map.external_rss_feed_remove 'admin/external_rss/remove/:id', :controller => 'admin/external_rss_feed', :action => 'remove'
  end
  
  def activate
    admin.tabs.add "External RSS", "/admin/external_rss", :after => "Pages", :visibility => [:all]
    
    Page.send :include, ExternalRssTags
  end
  
  def deactivate
    admin.tabs.remove "External RSS"
  end
  
end